﻿using System;

namespace Supermodel.Exceptions {
	public class SupermodelException : System.Exception 
    {
		public SupermodelException() { }
        public SupermodelException(string msg) : base(msg) { }
	}

    public class FormModelPropertyCantBeAutomapedException : SupermodelException
    {
        public FormModelPropertyCantBeAutomapedException(string msg) : base(msg) { }
    }

    public class SupermodelReflectionPropertyCantBeInvoked : SupermodelException
    {
        public SupermodelReflectionPropertyCantBeInvoked(Type type, string propertyName) 
            : base(string.Format("Property {0} does not exist in Type {1}", propertyName, type.Name)) { }
    }

    public class SupermodelReflectionMethodCantBeInvoked : SupermodelException
    {
        public SupermodelReflectionMethodCantBeInvoked(Type type, string methodName)
            : base(string.Format("Property {0} does not exist in Type {1}", methodName, type.Name)) { }
    }

    public class SettingParentIdOnRootException : SupermodelException { }

    public class ChangingParentIdOnChildtoInvalidValueException : SupermodelException {}
}
